package com.zhihuiyanche.common.util;

public class WechatShareUrlsUtil
{
	/**
	 * 根据类型获取要跳转的url地址
	 * 
	 * @param share_type
	 * @param share_style
	 * @return
	 */
	public static String grapUrl(String share_type, String share_style, String openId, String tenantId, String contextPath)
	{
		String result = "";
		if ("game".equals(share_type))
		{
			result = WechatShareUrlsUtil.grapGameUrl(share_style, openId, tenantId, contextPath);
		}
		return result;
	}

	public static String grapGameUrl(String share_style, String openId, String tenantId, String contextPath)
	{
		String url = "";
		String sctx = Constant.getSystemMap().get("product_wechat_service_ip") + contextPath + "/pages/weixin/front2/games";
		if ("hjkg".equals(share_style))
		{
			url = sctx + "/hjkg/index.html";
		}
		else if ("kxxxl".equals(share_style))
		{
			url = sctx + "/kaixinlian/index.html";
		}
		else if ("xnfff".equals(share_style))
		{
			url = sctx + "/xiaoniaofeifei/index.html";
		}
		url += "?openId=" + openId + "&tenantId=" + tenantId + "&type=" + share_style;
		return url;
	}
}
